{extend name="extend:iframe" /}

{block name="css"}
<link rel="stylesheet" type="text/css" href="/public/admin/css/layout.global.css" />
<link rel="stylesheet" type="text/css" href="/public/plug/FormCombox/FormCombox.css" />
<style type="text/css">
	.layout-form * {
		font-size: 14px!important;
	}
</style>
{/block}


{block name="body"}
<div class="_title">
    <div class="_main">修改密码</div>
</div>
<div class="_content">
	<form class="layout-form p-t-6x" id="layout-form-editpwd" action="/*" onsubmit="return false;" style="padding-left: 190px; padding-right: 300px;">
		<div class="layout-combox "><label class="layout-form-label">原密码</label>
			<div class="layout-form-ipt"><input type="password" name="passport" placeholder="请输入原密码"></div>
		</div>
		<div class="layout-combox "><label class="layout-form-label">新密码</label>
			<div class="layout-form-ipt"><input type="password" name="password" placeholder="请输入新密码"></div>
		</div>
		<div class="layout-combox "><label class="layout-form-label">再次输入</label>
			<div class="layout-form-ipt"><input type="password" name="cofimpwd" placeholder="再次输入新密码"></div>
		</div>
	</form>
	<div class="box-buttom clearfix p-b-4x" style="width: 240px; padding-left: 290px;">
		<a href="javascript:;" class="submit-buttom float-left fs14r" id="btn-editpwd-submit">确定</a>
	</div>
</div>
{/block}


{block name="js"}
<script type="text/javascript" src="/public/plug/layer/layer.min.js"></script>
<script type="text/javascript" src="/public/modules/tool.js"></script>
<script type="text/javascript" src="/public/modules/interactive.js"></script>
<script type="text/javascript">
	$(function() {
		$('#btn-editpwd-submit').on('click', submitEditpwd);
	});
	// 修改密码
	function submitEditpwd() {
		var data_opt = {};
		$('#layout-form-editpwd').find('input[type=password]').each(function() {
			var name = this.name;
			data_opt[name] = this.value;
		});
		layer.load(0, {
			shade: [0.08, '#000']
		});
		ajax().put('/api?manager.pwd.update', data_opt, function(res) {
			layer.closeAll('loading');
			if(res.status == 201) {
				window.parent.system.success('修改成功');
			} else {
				window.parent.system.error(res.error);
			}
		});
	}
</script>
{/block}